home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / blfsys.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-10  |  2.0 KB  |  79 lines

  1. #include "blfsys.h"
  2. #include "help.h"
  3.  
  4.  
  5. BlockFile::BlockFile(char* h, rect coords, char* fName)
  6.     : Block(coords, fName,  h, 3, FIXED, SHOW_BORDER, SHOW_BORDER,
  7.         0, 16, 16)
  8.     {
  9.     file_system = new FileSystem(rect(coords.origin.X + 2,
  10.                       coords.origin.Y + 5,
  11.                       coords.corner.X - 4,
  12.                       coords.corner.Y - 2));
  13.     edit = new EditLine(loc(coords.origin.X + 2, coords.origin.Y + 3),
  14.                 coords.width() - 7, 80,
  15.                 BUTTON_BORDER, 16, 1);
  16.  
  17.     edit->set_ret(RET_OK);
  18.     file_system->set_ret(RET_OK);
  19.  
  20.     insert(edit, 1);
  21.     add(file_system);
  22.  
  23.     assign(file_system, left_element, AC_LEFT);
  24.     assign(file_system, right_element, AC_RIGHT);
  25.     assign(file_system, up_element, AC_UP);
  26.     assign(file_system, dn_element, AC_DOWN);
  27.     assign(file_system, cancel_element, AC_CANCEL);
  28.     assign(file_system, pg_up_element, AC_PG_UP);
  29.     assign(file_system, pg_dn_element, AC_PG_DN);
  30.  
  31.     assign(file_system, edit, AC_SELECT);
  32.     assign(0, file_system, AC_SELECT);
  33.     }
  34.  
  35. ////////////////////////////
  36. void BlockFile::rearrange()
  37.     {
  38.     Block::rearrange();
  39.     rect coord = textRect(w1->bound());
  40.  
  41.     edit->repose(rect(coord.origin.X + 2, coord.origin.Y + 3,
  42.               coord.corner.X - 5, coord.origin.Y + 5));
  43.  
  44.     file_system->repose(rect(coord.origin.X + 2,
  45.                  coord.origin.Y + 5,
  46.                  coord.corner.X - 4,
  47.                  coord.corner.Y - 2));
  48.     }
  49. ////////////////////////////
  50. void BlockFile::exe(int act)
  51.     {
  52.     char reserv[MAXPATH];
  53.     getcwd(reserv, MAXPATH);
  54.     int res_disk = getdisk();
  55.  
  56.     Block::exe(act);
  57.  
  58.     setdisk(res_disk);
  59.     chdir(reserv);
  60.     }
  61. /////////////////////////////
  62. /*
  63. void main()
  64.     {
  65.     if(!init_KNOW_HOW())
  66.         return;
  67.     setfillstyle(SOLID_FILL, pColorSet->colors.BAK_COLOR);
  68.     bar(0, 0, getmaxx(), getmaxy());
  69.  
  70.     BlockFile* s = new BlockFile("FILE SYSTEM");
  71.  
  72.     s->show();
  73.     s->exe();
  74.  
  75.     delete s;
  76.     close_KNOW_HOW();
  77.     closegraph();
  78.     }
  79. */